<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


/**
 * Description of Order
 *
 * @author Administrator
 */

namespace Api\Api\Member;
use Api\Api\Base;
class Member extends Base {
    //put your code here
    private $memberModel;
    
    function __construct() {
        parent::__construct();
        $this->orderModel = D("site_member");
    }
    
    function Member_add($data){
        $site_id=$data['app_id'];
        $data['info_string']=  json_decode($data['info_string'],1);
        $member=$data['info_string'];
        
        if(!$member['id']){
            $this->setError(self::USER_ID_ERROR, "ID为空");
            return false;
        }
        if(!$member['name']){
            $this->setError(self::USER_ID_ERROR, "name为空");
            return false;
        }
        if(!site_memberadd($member,$site_id,$imsg)){
            $this->setError(self::ADD_FAIL, $imsg);
            return FALSE;
        }
        return true;
    }
}
